<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html>
<html lang="en">

<head>

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
	content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">

<title>CMS后台管理系统</title>

<!-- Bootstrap core CSS-->
<link href="/libs/bootstrap/css/bootstrap.min.css" rel="stylesheet">

<!-- Custom fonts for this template-->
<link href="/libs/fontawesome-free/css/all.min.css" rel="stylesheet"
	type="text/css">

<!-- Custom styles for this template-->
<link href="/libs/sb-admin/sb-admin.css" rel="stylesheet">

<!-- 富文本编辑插件 -->
<link href="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.9/summernote.css" rel="stylesheet">
<!--  <link href="libs/summernote/summernote.css" rel="stylesheet"> -->
<link rel="stylesheet" type="text/css" href="/css/cms.css" />

</head>

<body id="page-top">

	<!-- 后台管理系统顶部 -->
	<jsp:include page="_inc_top.jsp" />

	<div id="wrapper">

		<!-- 后台管理系统左部菜单 -->
		<jsp:include page="_inc_left.jsp" />

		<div id="content-wrapper">

			<div class="container-fluid">

				<!-- 面包屑 -->
				<ol class="breadcrumb">
					<li class="breadcrumb-item"><a href="/admin/home">后台首页</a></li>
					<li class="breadcrumb-item active">文章管理</li>
				</ol>

				<!-- Page Content -->
				<h1>审核博客</h1>

					<hr />
						<div class="card">
							<div class="card-body">
								<form action="/article/audit" method="post">
									<input type="hidden" id="id" value="${blog.id }"/>
									
				    	<p>
				    		<input name="title" class="form-control col-md-8"
											value="${blog.title }" disabled="disabled"/>
				    	</p>
				    	<br/>
				    	<br/>
				    	<p id="content-rich-edit">
				    		<input name="content" id="content" rows="20" class="form-control" value="${blog.content}" readonly="readonly">
				    	</p>
				    	
				    	<p>
				    		<input name="summary" rows="3" class="form-control"
											value="${blog.summary}"disabled="disabled">
				    	</p>
				    	
				    	<p>
				    		<span ><input type="text" value="${blog.category.name }" name="categoryName" disabled="disabled"/></span>
				    	</p>
				    	
				    	<p>上传封面：
					    	<c:if test="${not empty blog.cover}">
					    		<input type="hidden" name="cover" />
					    		<span id="coverBox">
					    		<img alt="图片预览" src="${blog.cover}" height="50">
					    		</span>
					    	</c:if>
				    	</p>
				    	
				    	<p>
				    		<button type="button" id="auditBtn1" >通过</button>
				    		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
				    		<button type="button" id="auditBtn2" >不通过</button> 
				    	</p>
				    	
				    	</form>
				    	</div>
				    	</div>

				</div>
			<!-- /.container-fluid -->

			<!-- Sticky Footer -->
			<footer class="sticky-footer">
				<div class="container my-auto">
					<div class="copyright text-center my-auto">
						<span>Copyright © Your Website 2018</span>
					</div>
				</div>
			</footer>

		</div>
		<!-- /.content-wrapper -->

	</div>
	<!-- /#wrapper -->

	<!-- Scroll to Top Button-->
	<a class="scroll-to-top rounded" href="#page-top"> <i
		class="fas fa-angle-up"></i>
	</a>

	<!-- Logout Modal-->
	<div class="modal fade" id="logoutModal" tabindex="-1" role="dialog"
		aria-labelledby="exampleModalLabel" aria-hidden="true">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<h5 class="modal-title" id="exampleModalLabel">Ready to Leave?</h5>
					<button class="close" type="button" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">×</span>
					</button>
				</div>
				<div class="modal-body">Select "Logout" below if you are ready
					to end your current session.</div>
				<div class="modal-footer">
					<button class="btn btn-secondary" type="button"
						data-dismiss="modal">Cancel</button>
					<a class="btn btn-primary" href="login.html">Logout</a>
				</div>
			</div>
		</div>
	</div>

	<!-- Bootstrap core JavaScript-->
	<script src="/libs/jquery/jquery.min.js"></script>
	<script src="/libs/bootstrap/js/bootstrap.bundle.min.js"></script>

	<!-- Custom scripts for all pages-->
	<script src="/libs/sb-admin/sb-admin.min.js"></script>
<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
	<script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
	<!-- 富文本编辑插件的js库 -->
<script src="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.9/summernote.js"></script>	
<!-- 	 <script type="text/javascript" src="libs/summernote/summernote.js"></script> -->
	<script type="text/javascript">
		$(document).ready(
						function() {

							$("#auditBtn1").click(function(){
								var id = $("#id").val();
								location="/admin/audit?articleId="+id+"&status=1";
							});
							$("#auditBtn2").click(function(){
								var id = $("#id").val();
								location="/admin/audit?articleId="+id+"&status=-1";
							});
						});
	</script>

</body>

</html>
